#!/bin/sh
name=`echo $JUJU_DISPATCH_PATH`
# only call the hook specified in JUJU_DISPATCH_PATH if it exists,
# otherwise juju will assume the hook has failed and keep retrying.
if [ -f "$JUJU_DISPATCH_PATH" ]; then
    juju-log -l INFO "Calling $name, from dispatch"
    exec $JUJU_DISPATCH_PATH "$@"
else
    juju-log -l INFO "Dispatch skipping: $name does not exist."
fi
